package com.easyto.order.controller;

import com.easyto.order.apis.PayFeignApi;
import com.easyto.order.response.UserDTO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/fegin")
public class OrderFeignController {

    @Resource
    PayFeignApi payFeignApi;

    @GetMapping("/getPayApi")
    public String getPayApi() {

        System.out.println(">>>>>>>>>>>>>> OrderFeignController");
        return payFeignApi.getPayApi();
    }

    @GetMapping("/getUserInfo/{userId}")
    public UserDTO getPayApi(@PathVariable("userId") String userId) {

        System.out.println(">>>>>>>>>>>>>> OrderFeignController");

        UserDTO userDTO = payFeignApi.queryUserById(userId);
        return userDTO;
    }
}
